package com.heima.client;

import com.heima.config.FeignConfig;
import com.heima.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//声明当前类是feign客户端，指定服务名为user-service
@FeignClient(value="user-service",fallback = UserClientFallback.class,configuration = FeignConfig.class)
public interface UserClient
{
    @GetMapping("/user/{id}")
    //http://user-service/user/4
    User queryById(@PathVariable Long id);
}
